package org.fastmvc.resource.location.impl;

import java.util.List;
import java.util.regex.Pattern;

import org.fastmvc.log.Log;
import org.fastmvc.log.Logs;
import org.fastmvc.resource.FastMvcResource;
import org.fastmvc.resource.location.ResourceLocation;

/**
 * <类描述>
 *
 * @author tangch
 * @date 2017年11月08日 9:43
 */
public class ErrorResourceLocation extends ResourceLocation {
	private Object loc;

	private static final Log log = Logs.get();

	@Override
	public String getId() {
		return null;
	}

	@Override
	public void scan(String base, Pattern pattern, List<FastMvcResource> list) {

	}


	public static ErrorResourceLocation make(Object loc) {
		if (loc == null) {
			log.debug("null scan path object");
		}
		return new ErrorResourceLocation(loc);
	}

	private ErrorResourceLocation(Object loc) {
		this.loc = loc;
		if (log.isInfoEnabled()) {
			log.info("[loc=" + loc + "]not exist");
		}
	}
	@Override
	public String toString() {
		return "ErrorResourceLocation [loc=" + loc + "]";
	}

	public String id() {
		return String.valueOf(loc);
	}
}
